﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PortalParts/Portal.Master" AutoEventWireup="true" CodeBehind="MassesVoiceMoreDefault.aspx.cs" Inherits="ZHDJ.Web.Portal.Grassroots.MassesVoiceMoreDefault" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="../../Resource/themes/default/css/party.portal.css" rel="stylesheet" />
	<style>
		.cztable .table_b tr {
			height: 24px;
		}
	</style>
    <script src="../../Resource/js/jquery/jquery.pagination.js"></script>
    <script src="../../Resource/js/default/jquery.tmpl.min.js"></script>
    <script src="../../Resource/js/knockout/knockout-3.4.0.js"></script>
    <script src="/Resource/js/jquery/jquery.pagination.js"></script>
    <script src="../../Resource/ueditor/ueditor.config.js"></script>
    <script src="../../Resource/ueditor/ueditor.all.min.js"></script>
    <script>
        var pageSize = 10, isBind = false;
        var initImgSize = function () {
            $('.nailthumb-container').each(function (i, n) {
                $(n).nailthumb({ width: 122, height: 145, method: 'resize', fitDirection: 'center center' });
            });

        }
        var paginationPara = {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 4, //主体页数
            callback: pageselectCallback,
            items_per_page: pageSize, //每页显示1项
            prev_text: "上一页",
            next_text: "下一页",
            link_to: "javascript:void(0);"
        }
        var ViewModel = {
            qdate: ko.observableArray(),
            loadContacts: function (pageIndex) {
                $.get("MassesVoiceMore.aspx", {
                    PageIndex: pageIndex,
                    PageSize: pageSize,
                    ItemID: $("#ctl00_ContentPlaceHolder1_hdItemID").val(),
                    QueryStatus: $("#QueryStatus").val(),
                    QueryText: $("#QueryText").val(),
                    r: (new Date()).getTime()
                },
                function (data) {
                    var ss = eval("(" + data + ")");

                    ViewModel.qdate(eval("(" + data + ")"));
                });
            }
        }

        function initPage() {
            $.get("MassesVoiceMore.aspx", {
                DataCount: 1,
                QueryStatus: $("#QueryStatus").val(),
                QueryText: $("#QueryText").val(),
                ItemID: $("#ctl00_ContentPlaceHolder1_hdItemID").val(),
                r: (new Date()).getTime()
            },
                function (data) {
                    var totalCount = parseInt(data);
                    if (totalCount == 0) {
                        $("#trnonedata").show();

                    } else {
                        $("#trnonedata").hide();
                    }
                    $("#pagination").pagination(totalCount, paginationPara);
                });
        }
        function pageselectCallback(pageIndex, jq) {
            ViewModel.loadContacts(pageIndex);
            if (!isBind) {
                ko.applyBindings(ViewModel);
                isBind = true;
            }

        }
        $(function () {
            $("#btnQuery").click(function () {
                initPage();
            });

            initPage();
        });
        function su() {
            window.location.href = window.location.href;
        }

    </script>
    <script id="myTemplate" type="text/x-jquery-tmpl">
        <tr class="tr_a">
            <td class="td1"><a href="MassesVoiceDetail.aspx?id=${ID}" target="_blank">${Title}</a></td>
            <td class="td2">${MobileNo}</td>
            <td class="td2">${StatusName}</td>
            <td class="td2">${CollectionTime2}</td>
            <td class="td2">${ModifyTime2}</td>
        </tr>
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
     <div class="s_content_border s_content_k menu_content_k">
     <asp:HiddenField ID="hdItemID" runat="server" />

   <div class="morequerybar">
        <table>
            <tr>
                <td><span>主题：</span></td>
                <td>
                    <input class="text1 " id="QueryText" type="text" style="width: 200px;margin-right: 20px;" /></td>
                <td><span>状态：</span></td>
                <td>

                    <select class="text1 " id="QueryStatus" style="width: 200px;height: 38px;line-height: 38px;">
                        <option value="">请选择</option>
                        <option value="1">待回复</option>
                        <option value="4">已回复</option>
                    </select>

                </td>
                <td>
                    <button type="button" class="mybtn" id="btnQuery" style="width: 60px;margin-left:20px;height: 38px;line-height: 38px;">搜索</button>
                </td>
            </tr>
        </table>
    </div>
    <div class="cztable" style="margin-top: 20px;">
        <table class="table_a" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td class="tdbar_a" style="width: auto;">主题</td>
                <td class="tdbar_a" style="width: 200px;">联系方式</td>
                <td class="tdbar_a" style="width: 200px;">状态</td>
                <td class="tdbar_a" style="width: 200px;">提交时间</td>
                <td class="tdbar_a" style="width: 200px;">回复时间</td>
            </tr>

            <!-- ko template: { name: 'myTemplate', foreach: qdate} -->
            <!-- /ko -->
            <tr style="display: none" id="trnonedata" class="tr_a">
                <td class="td2" style="text-align: center" colspan="5">无数据……
             </td>

            </tr>
        </table>
        <div class="pagination">
            <div id="pagination">
            </div>
        </div>
    </div>
     <f:PageManager ID="PageManager1" runat="server" />
    <asp:HiddenField ID="hdStudioID" runat="server" />
    <f:Form runat="server" ShowBorder="false" ShowHeader="false" ID="Form21" Margin="20 0 0 0">

        <Items>
            <f:ContentPanel runat="server" ID="MassesVoiceMoreDefaultCP" ShowBorder="false">

                <div class="cztable mycontactinfo">
                    <table class="table_b" border="0" cellspacing="0" cellpadding="0">
                        <tr class="tr_b ">
                            <td class="tdbar" colspan="4">
                                <h5>群众心声</h5>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">姓名：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtUserName" Width="200px" Readonly="false" runat="server" Required="true" ShowRedStar="true"></f:TextBox>
                            </td>
                            <th class="th_b">联系方式：</th>
                            <td class="td_b" style="text-align: left;">
                                <f:TextBox ID="txtMobileNo" Width="200px" runat="server" Regex="^(1(([35][0-9])|(47)|[8][01236789]))\d{8}$" Required="true" ShowRedStar="true"></f:TextBox>
                            </td>
                        </tr>
                         <tr class="tr_b">
                            <th class="th_b">主题：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:TextBox ID="txtTitle" Width="557px" runat="server" Required="true" ShowRedStar="true"></f:TextBox>

                            </td>
                        </tr>

                        <tr class="tr_b">
                            <th class="th_b">反映内容：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:ContentPanel ID="ContentPanel1" runat="server" ShowBorder="false" ShowHeader="false">
                                    <script type="text/plain" id="editor"></script>
                                </f:ContentPanel>
                            </td>
                        </tr>
                        <tr class="tr_b">
                            <th class="th_b">是否公开：</th>
                            <td class="td_b" colspan="3" style="text-align: left;">
                                <f:CheckBox ID="cbxPublicity" runat="server" Label="" LabelAlign="right" Checked="true"></f:CheckBox>
                            </td>
                        </tr>
                        <tr class="tr_b mysubtn">
                            <td class="td_b" colspan="4" style="text-align: center">
                                <f:Button ID="btnSave" ValidateForms="Form21" CssClass="mybtn" OnClick="btnSave_Click" runat="server" Text="提交" OnClientClick="UESync();"></f:Button>
                            </td>
                        </tr>
                    </table>
                </div>
            </f:ContentPanel>
        </Items>
    </f:Form>
         </div>
 <script>
    var editorContent = '';

    var ue = UE.getEditor("editor", {
        initialFrameWidth: '100%',
        initialFrameHeight: '400px',
        enableAutoSave: false,
        saveInterval: 1000000,
        elementPathEnabled: false,
        autoHeightEnabled: false
    });

    ue.ready(function () {
        if (editorContent) {
            ue.setContent(editorContent);
        }
    });

    function UESync() {
        var editor = UE.getEditor('editor')
        editor.sync();
        return true;
    }
</script>

</asp:Content>
